// GridSetting.cpp : implementation file
//

#include "stdafx.h"
#include "FlowChartSoftware.h"
#include "GridSettingDlg.h"


// CGridSetting dialog

IMPLEMENT_DYNAMIC(CGridSettingDlg, CDialog)

CGridSettingDlg::CGridSettingDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGridSettingDlg::IDD, pParent)
	, m_gridWidht(20)
	, m_lineStyle(PS_DOT)
	, m_color(RGB(200,200,200))
	, m_showTop(false)
{

}

CGridSettingDlg::~CGridSettingDlg()
{
}

void CGridSettingDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_GRID_WIDTH, m_gridWidht);
	DDV_MinMaxInt(pDX, m_gridWidht, 1, 100);
	DDX_Radio(pDX, IDC_GRID_LINESTYLE, m_lineStyle);
	DDX_Check(pDX, IDC_GRID_SHOWTOP, (int&)m_showTop);
}


BEGIN_MESSAGE_MAP(CGridSettingDlg, CDialog)
	ON_BN_CLICKED(IDC_GRID_COLORSETTING, &CGridSettingDlg::OnBnClickedGridColorsetting)
END_MESSAGE_MAP()


// CGridSetting message handlers

void CGridSettingDlg::OnBnClickedGridColorsetting()
{
	// TODO: Add your control notification handler code here
	CColorDialog colorDlg;
	colorDlg.m_cc.Flags |= CC_RGBINIT | CC_FULLOPEN;
	colorDlg.m_cc.rgbResult = m_color;
	if( colorDlg.DoModal() == IDOK )
	{
		m_color = colorDlg.m_cc.rgbResult;
	}
}
